home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / freeli20.zip / textmac.inc < prev   
Text File  |  1996-07-01  |  4KB  |  111 lines

  1. ;****************** Macro include file
  2.  
  3. Macro       SET_CH                  ;; Set character
  4.                                     ;; Assumes ES = CurSeg
  5.             push di                 ;; Regs on Entry:
  6.             mov di,cx               ;;   BX = X
  7.             shl di,8                ;;   CX = Y
  8.             add di,bx               ;;   AL = char
  9.             add di,bx
  10.             mov [es:di],al
  11.             pop di
  12.  
  13. EndM
  14.  
  15. Macro       SET_AT                  ;; Set attribute
  16.                                     ;; Assumes ES = CurSeg
  17.             push di                 ;; Regs on Entry:
  18.             mov di,cx               ;;   BX = X
  19.             shl di,8                ;;   CX = Y
  20.             add di,bx               ;;   AL = attr
  21.             add di,bx
  22.             mov [es:di+1],al
  23.             pop di
  24.  
  25. EndM
  26.  
  27. Macro       SET_CHA                 ;; Set char & attr
  28.                                     ;; Assumes ES = CurSeg
  29.             push di                 ;; Regs on Entry:
  30.             mov di,cx               ;;   BX = X
  31.             shl di,8                ;;   CX = Y
  32.             add di,bx               ;;   AL = char
  33.             add di,bx               ;;   AH = attr
  34.             mov [es:di],ax
  35.             pop di
  36.  
  37. EndM
  38.  
  39. Macro       GET_CHA                 ;; Get char & attr
  40.                                     ;; Assumes ES = CurSeg
  41.             push di                 ;; Regs on Entry:
  42.             mov di,cx               ;;   BX = X
  43.             shl di,8                ;;   CX = Y
  44.             add di,bx               ;; Returns:
  45.             add di,bx               ;;   AL = char
  46.             mov ax,[es:di]          ;;   AH = attr
  47.             pop di
  48.  
  49. EndM
  50.  
  51. Macro       SET_ROW_CHA             ;; Set row of chars with attr
  52.                                     ;; Assumes ES = CurSeg
  53.             push cx di              ;; Regs on Entry:
  54.             mov di,cx               ;;   BX = X
  55.             shl di,8                ;;   CX = Y
  56.             add di,bx               ;;   DX = count
  57.             add di,bx               ;;   AL = char
  58.             mov cx,dx               ;;   AH = attr
  59.             rep stosw
  60.             pop di cx
  61.  
  62. EndM
  63.  
  64. Macro       SET_ROW_CH              ;; Set row of chars w/o attr
  65.                                     ;; Assumes ES = CurSeg
  66.             push cx di              ;; Regs on Entry:
  67.             mov di,cx               ;;   BX = X
  68.             shl di,8                ;;   CX = Y
  69.             add di,bx               ;;   DX = count
  70.             add di,bx               ;;   AL = char
  71.             mov cx,dx
  72.             mov [es:di],al
  73.             add di,2
  74.             dec cx
  75.             jnz $-7
  76.             pop di cx
  77.  
  78. EndM
  79.  
  80. Macro       SET_VROW_CHA            ;; Set vertical row of chars with attr
  81.                                     ;; Assumes ES = CurSeg
  82.             push cx di              ;; Regs on Entry:
  83.             mov di,cx               ;;   BX = X
  84.             shl di,8                ;;   CX = Y
  85.             add di,bx               ;;   DX = count
  86.             add di,bx               ;;   AL = char
  87.             mov cx,dx               ;;   AH = attr
  88.             mov [es:di],ax
  89.             add di,256
  90.             dec cx
  91.             jnz $-8
  92.             pop di cx
  93.  
  94. EndM
  95.  
  96. Macro       SET_VROW_CH             ;; Set vertical row of chars w/o attr
  97.                                     ;; Assumes ES = CurSeg
  98.             push cx di              ;; Regs on Entry:
  99.             mov di,cx               ;;   BX = X
  100.             shl di,8                ;;   CX = Y
  101.             add di,bx               ;;   DX = count
  102.             add di,bx               ;;   AL = char
  103.             mov cx,dx
  104.             mov [es:di],al
  105.             add di,256
  106.             dec cx
  107.             jnz $-8
  108.             pop di cx
  109.  
  110. EndM
  111.